package com.baseweb.webadmin.core.model.dao;

import com.baseweb.webadmin.core.model.bvo.*;
import com.baseweb.webadmin.core.model.pojo.*;
import com.baseweb.webadmin.core.util.RequestPage;
import org.joda.time.DateTime;

import java.util.List;
import java.util.Map;

public interface UserDao {

    public User selectUserById(Integer userid);

    public User selectUserByUserName(String username);

    public User selectUserByToken(String token);

    public List<User> selectUserByIds(List<Integer> ids);

    public List<User> selectUsers(String username);

    public List<UserRoleBvo> selectUsersByPage(Map map);

    public Integer selectUsersByNameRows(Map map);

    public List<User> selectUserByUserType(Integer userType, Integer status);

    public List<User> selectAgentUserList(Integer agentId, Integer status, String cn_name, String username, String identity, Integer start, Integer offset);
    public Integer selectAgentUserListCount(Integer agentId, Integer status, String cn_name, String username, String identity);

    public User selectUserByWxId(String openId, String unionId);

    /**
     * 根据邮箱在user表中判断该邮箱
     * 是否已经被使用
     *
     * @param email
     * @return
     */
    public List<User> selectUserByEmail(String email);

    public List<User> selectUserListByPage(Integer id, String username, Integer start, Integer offset);

    public Integer selectUserListCount(Integer id, String username);

    public List<User> selectUserListByTypeAndPage(Integer user_type, Integer start, Integer offset);

    public Integer selectUserListByTypeCount(Integer user_type);

    public Integer insertBizVerify(ByUserBizAuth byUserBizAuth);
    public ByUserBizAuth findBizVerify(Integer id);
    public List<ByUserBizAuth> selectBizVerifyListByPage(Integer userId, Integer authType, String name, Integer start, Integer offset, Integer status);
    public List<ByUserBizAuthvo> selectBizVerifyListByPage1(ByUserBizAuthvo auth, Integer start, Integer offset);
    public Integer selectBizVerifyListCount(Integer userId, Integer authType, String name, Integer status);
    public Integer selectBizVerifyListCount1(ByUserBizAuthvo auth);

    public List<UserVerifyBvo> selectBizVerifyStatusList(List<Integer> userId, Integer status);
    public List<ByUserBizAuth> selectBizVerifyStatusList1(Integer userId );

    public Integer insertBizPackage(ByUserBizPackage byUserBizPackage);
    public ByUserBizPackage findBizPackage(Integer id);
    public List<ByUserBizPackage> selectPackageListByPage(Integer userId, String name, Integer start, Integer offset);
    public Integer selectPackageListCount(Integer userId, String name);

    public Integer insertBizPackageDetail(ByUserBizPackageDetail byUserBizPackageDetail);
    public ByUserBizPackageDetail findBizPackageDetail(Integer id);
    public List<ByUserBizPackageDetail> selectPackageDetailListByPage(Integer userId, Integer packageId, Integer productId, Integer start, Integer offset);
    public Integer selectPackageDetailListCount(Integer userId, Integer packageId, Integer productId);

    public Integer insertBizProduct(ByUserBizProduct byUserBizProduct);
    public ByUserBizProduct findBizProduct(Integer id);
    public List<ByUserBizProduct> findBizProductList(List<Integer> ids);
    public List<ByUserBizProduct> selectProductListByPage(Integer userId, Integer productType, Integer channelId, Integer start, Integer offset,
                                                          String sortBy, String styleType, String price, String keyword, Integer status);

    public List<ByUserBizProductBvo> selectProductVoListByPage(Integer userId, String userName, String userMobile, String userChannel, String keyword,
                                                               Integer auditType, Integer status, String startTime, String endTime,
                                                               String province, String city, String county, Integer start, Integer offset);

    public List<ByUserBizProductBvo> selectProductVoListByPage(String userName, String userMobile, Integer userChannel, String keyword,
                                                               Integer auditType, Integer status, String startTime, String endTime,
                                                               String province, String city, String county, Integer start, Integer offset);

    public Integer selectProductListCount(Integer userId, Integer productType, Integer channelId,
                                          String sortBy, String styleType, String price, String keyword, Integer status);

    public Integer selectProductListCount(String userName, String userMobile, String userChannel, String keyword,
                                          Integer auditType, Integer status, String startTime, String endTime,
                                          String province, String city, String county);

    public Integer insertOpenCity(ByOpenCity byOpenCity);
    public ByOpenCity findOpenCity(Integer id);
    public Integer deleteOpenCity(Integer id);
    public List<ByOpenCity> selectOpenCityListByPage(Integer userId, Integer openType, String province, Integer start, Integer offset);
    public Integer selectOpenCityListCount(Integer userId, Integer openType, String province);
    public List<ByOpenCity> selectAllCities(Integer userId);

    public List<ByUserTrolley> selectTrolleyListByPage(Integer userId, Integer start, Integer offset);
    public Integer selectTrolleyListCount(Integer userId);
    public Integer insertTrolley(ByUserTrolley byUserTrolley);
    public ByUserTrolley findTrolley(Integer id);
    public ByUserTrolley findTrolleyByUserAndProduct(Integer userId, Integer productId);

    /**
     * zx  购物车联合查询全部
     * @param userId
     * @return
     */
    List<ByUserTrolleyBvo> selectByUserTrolleyList(Integer userId);
    public List<ByUserBizProduct> selectTrolleyProductListByPage(Integer userId, Integer start, Integer offset);
    public Integer selectTrolleyProductListCount(Integer userId);

    public Integer deleteTrolley(Integer id);
    public Integer deleteTrolleyByUserAndProduct(Integer userId, List<Integer> productIds);


    public Integer insertInvite(ByUserInvite byUserInvite);
    public ByUserInvite findInvite(Integer id);
    //谁邀请了我
    public ByUserInvite findInviteBy(Integer userId);
    //被我邀请的人
    public List<ByUserInvite> selectInviteListByPage(Integer userId, Integer inviteBy, Integer start, Integer offset);
    public Integer selectInviteListCount(Integer userId, Integer inviteBy);

    public Integer insertBudget(ByUserWedBudget byUserWedBudget);
    public ByUserWedBudget findBudget(Integer id);
    public List<ByUserWedBudget> selectBudgetListByPage(Integer userId, Integer start, Integer offset);
    public List<ByUserWedBudget> selectIntentCustomListByPage(ByUserWedBudget custom, Integer start, Integer offset);
    public Integer selectBudgetListCount(Integer userId);
    public Integer selectIntentCustomListCount(ByUserWedBudget custom);

    public Integer insertExample(ByUserExample byUserExample);
    public ByUserExample findExample(Integer id);
    public Integer deleteExample(Integer id);
    public List<ByUserExample> selectExampleListByPage(Integer userId, Integer status, Integer exampleType, Integer start, Integer offset);

    /**
     * 作品管理分页查询
     * @param exampleBvo
     * @param requestPage
     * @return
     */
    public List<ByUserExampleBvo> selectExampleBvoListByPage(ByUserExampleBvo exampleBvo, RequestPage requestPage);
    public Integer selectExampleListCount(Integer userId, Integer status, Integer exampleType);


    public Integer insertExampleDetail(ByUserExampleDetail byUserExampleDetail);
    public ByUserExampleDetail findExampleDetail(Integer id);
    public Integer deleteExampleDetail(Integer id);
    public List<ByUserExampleDetail> selectExampleDetailListByPage(Integer userId, Integer exampleId, Integer status, Integer start, Integer offset);
    public Integer selectExampleDetailListCount(Integer userId, Integer exampleId, Integer status);


    public List<User> selectBizUserListByPage(Integer productType, Integer keyId,Integer channelId, String sortBy, String styleType, String price, String keyword, Integer start, Integer offset,
                                              Integer status, String city, String area, String orderBy);
    public Integer selectBizUserListCount(Integer productType, Integer keyId,Integer channelId, String sortBy, String styleType, String price, String keyword,
                                          Integer status, String city, String area);


    public Integer insertAgentCity(ByUserBizAgentCity byUserBizAgentCity);
    public ByUserBizAgentCity findAgentCity(Integer id);
    public Integer deleteAgentCity(Integer id);
    public List<ByUserBizAgentCity> selectAgentCityListByPage(Integer userId, Integer start, Integer offset);
    public Integer selectAgentCityListCount(Integer userId);

    public Integer insertRecommendUser(ByUserRecommend byUserRecommend);
    public ByUserRecommend findRecommendUser(Integer id);
    public Integer deleteRecommendUser(Integer id);
    public List<ByUserRecommend> selectRecommendUserListByPage(Integer userId, Integer status, Integer exampleId, Integer start, Integer offset);

    /**
     * 分页查询案例推荐
     * @param userId
     * @param status
     * @param exampleId
     * @return
     */
    public List<ByUserRecommendBvo> selectByUserRecommendBvoListByPage(Integer userId, Integer status, Integer exampleId,RequestPage page);
    public Integer selectRecommendUserListCount(Integer userId, Integer status, Integer exampleId);

    /**
     * 删除案例选婚礼预算
     * @param id
     * @return
     */
    public Integer deleteByExampleBudgetKey(Integer id);

    /**
     * 根据主键查询婚礼预算
     * @param id
     * @return
     */
    public ByExampleBudget selectByExampleBudgetKey(Integer id);

    /**
     * 新增婚礼预算
     * @param record
     * @return
     */
    public Integer insertExampleBudget(ByExampleBudget record);

    /**
     * 根据主键修改婚礼预算
     * @param byExampleBudget
     * @return
     */
    public Integer updateByExampleBudgetKey(ByExampleBudget byExampleBudget);

    /**
     * 分页查询婚礼预算
     * @param exampleId
     * @param page
     * @return
     */
    public List<ByExampleBudget> selectExampleBudgetListByPage(Integer exampleId, RequestPage page);

    /**
     * 删除案例评论
     * @param id
     * @return
     */
    public Integer deleteByExampleDiscussKey(Integer id);

    /**
     * 根据主键查询案例评论
     * @param id
     * @return
     */
    public ByExampleDiscuss selectByExampleDiscussKey(Integer id);

    /**
     * 新增案例评论
     * @param record
     * @return
     */
    public Integer insertExampleDiscuss(ByExampleDiscuss record);

    /**
     * 根据主键修改案例评论
     * @param
     * @return
     */
    public Integer updateByExampleDiscussKey(ByExampleDiscuss byExampleDiscuss);

    /**
     * 分页查询案例评论
     * @param exampleId
     * @param page
     * @return
     */
    public List<ByExampleDiscuss> selectExampleDiscussListByPage(Integer exampleId, RequestPage page);

    /**
     * 删除字典表
     * @param id
     * @return
     */
    public Integer deleteByDictKey(Integer id);

    /**
     * 根据主键查询字典表
     * @param id
     * @return
     */
    public Dict selectByDictKey(Integer id);

    /**
     * 新增字典表
     * @param record
     * @return
     */
    public Integer insertDict(Dict record);

    /**
     * 根据主键修改字典表
     * @param
     * @return
     */
    public Integer updateByDictKey(Dict dict);

    /**
     * 分页查询字典表
     * @param type
     * @param page
     * @return
     */
    public List<Dict> selectDictListByPage(Integer type, RequestPage page);

    /**
     * 新增用户消息
     * @param userMessage
     * @return
     */
    public Integer insertUserMessage(ByUserMessage userMessage);

    /**
     * 分页查询用户消息
     * @param userId
     * @param page
     * @return
     */
    public List<ByUserMessage> selectUserMessageByPage(Integer userId, RequestPage page);

    /**
     * 删除用户消息
     * @param id
     * @return
     */
    public Integer deleteByUserMessageKey(Integer id);
    public List<ByUserBizAuth> findUserBizAuthByUserId(int userId);
}
